package cn.bgs.controller;


import cn.bgs.common.R;
import cn.bgs.pojo.VolunteerService;
import cn.bgs.service.VolunteerServiceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 志愿服务表 前端控制器
 * </p>
 *
 * @author Mr.Zhao
 * @since 2022-08-08
 */
@RestController
@RequestMapping("/volunteer-service")
public class VolunteerServiceController {

    @Autowired
    private VolunteerServiceService volunteerServiceService;

    @GetMapping("/findVolunteerService")
    public R findVolunteerService(@RequestParam String styShowTitle,@RequestParam String styShowState){

        return volunteerServiceService.findVolunteerService(styShowTitle, styShowState);
    }

    @GetMapping("/findVolunteerServiceId")
    public R findVolunteerServiceId(@RequestParam Integer id){
        return volunteerServiceService.findVolunteerServiceId(id);
    }

    @PostMapping("/addVolunteerService")
    public R addVolunteerService(@RequestBody VolunteerService volunteerService){
        return volunteerServiceService.addVolunteerService(volunteerService);
    }

    @PostMapping("/updateVolunteerService")
    public R updateVolunteerService(@RequestBody VolunteerService volunteerService){
        return volunteerServiceService.updateVolunteerService(volunteerService);
    }

    @GetMapping("/delVolunteerService")
    public R delVolunteerService(@RequestParam Integer id){
        return volunteerServiceService.delVolunteerService(id);
    }
}

